package com.pig4cloud.pigx.common.security.resource.annotation;

import com.pig4cloud.pigx.common.security.resource.component.PigxResourceServerAutoConfiguration;
import com.pig4cloud.pigx.common.security.resource.component.PigxSecurityBeanDefinitionRegistrar;
import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @description:
 * @Author 兔子不吃窝边曹
 * @create 2022/8/5 15:42
 **/
@Documented
@Inherited
@EnableResourceServer
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Import({PigxResourceServerAutoConfiguration.class, PigxSecurityBeanDefinitionRegistrar.class})
public @interface EnablePigxResourceServer {

    /**
     * 是否开启本地模式
     *
     * @return true
     */
    boolean isLocal() default true;

}
